-- Test Selection:        if, if-else, nested if-else
-- Logical Operators:     and, or, not
-- Relational Operators:  <, >, <=, >=, ~=, ==
-- Program-ID:            TSelect.lua
-- OS:                    Windows
-- Compilier:             Eclipse/Lua Development Tools

i1 = 1; i2 = 2; i3 = 3; i4 = 4; i5 = 5; i6 = 6;

-- Test a simple if
if i1 < 2 then print(i1 .. " is less than 2") end;

-- Test if-else
if i2 > i3 then
  print(i2 .. " is greater than " .. i3);
else
  print(i2 .. " is not greater than " .. i3);
end

-- Test nested if and else-if
if i4 == 4 then
  if i4 <= i3 then
    print(i4 .. " is less than or equal to " .. i3);
  elseif i5 >= i3 then
    print(i5 .. " is greater than or equal to " .. i3);
  else
    print("No matches for else-if statement");
  end
else
  print(i4 .. "did not equal 4");
end

-- Test ~= *not equal to, and == *equal to
if i5 ~= i6 and i5 == 5 then
  print("i5 does equal 5");
end
print("Press enter to exit.....");
re = io.read();
